package javaBase.reflectPackage;


/**
 * @program: jvm
 * @description
 * @author: tkk fendoukaoziji
 * @create: 2019-04-25 16:58
 **/
public class TestReflecct {
    public static void main(String[] args) throws ClassNotFoundException {
        Class<Myclass> c1 = Myclass.class;
        System.out.println(Myclass.bubian);//注意加载静态常量时没有实例化类   静态常量在编译时就放入class类文件常量池
        System.out.println(Myclass.bian);//调用静变量初始化类
        Class<?> c2 = Class.forName("javaBase.reflectPackage.Myclass");
        System.out.println("结束");
    }
}
class Myclass{
    static InnerClassNew in=new InnerClassNew();
    static final int bubian=333;
    static int bian=123;
    static{
        System.out.println("来自静态代码块");
    }
    static class InnerClassNew{
        static{
            System.out.println("来自静态内部类中的代码块");
        }
    }
}
